package com.bifang.common.constant.enums.common;

/**
 * ${enumComment!}
 *
 * @author ${author}
 * @since ${date}
 */
public enum ${enumName}Enum {
<#list entityList as entity>
    /** ${entity.dict_value} */
    <#if entity_index lt entitySize-1>
    ${entity.enumKey}("${entity.dict_key}", "${entity.dict_value}"),
    <#else>
    ${entity.enumKey}("${entity.dict_key}", "${entity.dict_value}");
    </#if>
</#list>

    private String type;
    private String text;

    ${enumName}Enum(String type, String text) {
        this.type = type;
        this.text = text;
    }

    public String getType() {
        return this.type;
    }

    public String getText() {
        return this.text;
    }

    public static ${enumName}Enum getByType(String type) {
        for (${enumName}Enum typeEnum : values()) {
            if (typeEnum.getType().equalsIgnoreCase(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
